<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateRepliesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * 政策咨询、诉求、举报回复
     * 多态模型
     * @return void
     */
    public function up()
    {
        Schema::create('replies', function (Blueprint $table) {
            $table->id();
            $table->text('content');
            $table->text('attachments')->nullable()->comment('附件信息,支持图片、word、excel、ppt、pdf');
            $table->text("remark")->nullable()->comment('备注');
            $table->foreignId('wxuser_id')->nullable()->default(1)->comment('发起人ID');
            //回复人：wxuser user
            $table->morphs('replyable');
            $table->timestamps();
//            注意为1表示后台管理员，user_id=1
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('replies');
    }
}
